<template>
    <div class="item">
        <!-- <div class="text">为你精选</div> -->
        <div class="goods">
            <div class="box" v-for="(item, index) in list" :key="index">
                <div class="imgdiv">
                    <img class="img" :src="item.listPicUrl" alt="" />
                </div>
                <div class="text">
                    <img class="image" src="https://yanxuan.nosdn.127.net/static-union/16698631101bcf18.png" alt="" />
                    {{ item.name }}
                </div>

                <div class="vip" v-if="item.itemTagList.length">
                    <img class="img" src="https://yanxuan.nosdn.127.net/static-union/166909947513c0c8.png" alt="" />
                    可用红包
                </div>
                <div class="money">
                    <div class="new">
                        <div class="item">{{ item.finalPriceInfoVO.priceInfo.finalPrice?.prefix }}</div>
                        <div class="icon">￥</div>
                        <text class="text">{{ item.finalPriceInfoVO.priceInfo.finalPrice?.price }}</text>
                    </div>
                    <div class="old">￥{{ item.finalPriceInfoVO.priceInfo.finalPrice?.counterPrice }}</div>
                </div>
                <div class="day">
                    <div class="hover">
                        {{
                            item.finalPriceInfoVO.banner?.title
                                ? item.finalPriceInfoVO.banner?.title
                                : item.finalPriceInfoVO.banner?.content
                        }}
                    </div>
                    &nbsp; {{ item.finalPriceInfoVO.banner?.title ? item.finalPriceInfoVO.banner?.content : '' }}
                </div>
            </div>
        </div>
    </div>
</template>

<script lang="ts" setup>
const pror = defineProps(['list']);
// console.log(pror.list);
</script>

<style lang="less" scoped>
.item {
    width: 100%;
    .goods {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        .box {
            width: 48%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin: 10rpx 0;
            .imgdiv {
                width: 320rpx;
                height: 320rpx;
                .img {
                    width: 320rpx;
                    height: 320rpx;
                }
            }
            .text {
                margin: 5rpx 15rpx;
                font-size: 28rpx;
                height: 80rpx;
                line-height: 40rpx;
                // text-align: center;

                .image {
                    border-radius: 50%;
                    width: 30rpx;
                    height: 30rpx;
                    vertical-align: -4rpx;
                }
            }
            .vip {
                display: flex;
                border-radius: 20rpx;
                align-self: flex-start;
                margin: 5rpx 15rpx;
                color: #333;
                font-size: 24rpx;
                height: 24prx;
                line-height: 24rpx;
                .img {
                    width: 22rpx;
                    height: 22rpx;
                }
            }
            .money {
                display: flex;
                justify-content: space-around;
                height: 60rpx;
                .new {
                    display: flex;

                    .item {
                        color: red;
                        align-self: flex-end;
                    }
                    .icon {
                        font-size: 40rpx;
                        color: red;
                        align-self: flex-end;
                    }
                    .text {
                        font-size: 40rpx;
                        color: red;
                    }
                }
                .old {
                    color: #999;
                    font-size: 26rpx;
                    align-self: flex-end;
                    text-decoration: line-through;
                }
            }
            .day {
                margin: 10rpx 0;
                display: flex;
                justify-content: flex-start;
                background: #ffe9eb;
                color: #fa1e32;
                font-size: 22rpx;
                border-radius: 20rpx;

                .hover {
                    border-radius: 20rpx;
                    color: white;
                    background: #fa1e32;
                }
            }
        }
    }
}
</style>
